package day05;

import java.util.Scanner;
public class ArrarDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int[ ]arr=new int[5];
        int max=0;
        for(int i =0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*100);
            max +=arr[i];
            System.out.println("数字："+arr[i]);
        }
        System.out.println("平均值为："+(max/arr.length-1));

        /*
        int[] arr=new int[10];
        for(int i =0;i<arr.length;i++){
            arr[i] = (int)(Math.random()*100);
            System.out.println(arr[i]);
        }

         */

        /*
        //声明数组
        int[] a = new int[8];
        double[] b = new double[10];
        boolean[] c = new boolean[50];

        //声明数组，并初始化
        int[] aa = new int[]{1, 2, 3, 4, 5, 6, 7, 8};
        int[] aaa = {1, 2, 2, 2, 2, 2, 2, 2, 2,};
        double[] bb = new double[]{1.1, 2.2, 3.3, 4.4, 5.5};
        boolean[] cc = new boolean[]{true, false, false, true};
        int[] s = {55, 88, 66};
        int[] ss;
        ss = new int[]{5, 6, 7, 8};


        int[] arr = new int[3];
        System.out.println("数组的长度：" + arr.length);
        System.out.println(arr[0]);
        arr[0] = 100;
        arr[1] = 200;
        arr[2] = 300;
        System.out.println(arr[arr.length - 1]);

        int[]adc = new int[4];
        adc[0]=1350;
        adc[1]=3150;
        adc[2]=4800;
        adc[3]=6300;
        System.out.println(adc[3]);

         */
    }
}
